//
//  SellDetailTableViewCell.m
//  Wedding fantastic
//
//  Created by dllo on 15/7/4.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "SellDetailTableViewCell.h"

#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height

@implementation SellDetailTableViewCell
- (void)dealloc
{
    [_leftImage release];
    [_titleLabel release];
    [_collectLabel release];
    [_priceLabel release];
    [super dealloc];
}

- (instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.leftImage = [[UIImageView alloc] init];
        self.leftImage.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:self.leftImage];
        [_leftImage release];
        
        self.titleLabel = [[UILabel alloc] init];
        self.titleLabel.font = [UIFont systemFontOfSize:14];
        self.titleLabel.numberOfLines = 0;
        [self.contentView addSubview:self.titleLabel];
        [_titleLabel release];
        
        self.collectLabel = [[UILabel alloc] init];
        self.collectLabel.textColor = [UIColor grayColor];
        self.collectLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:self.collectLabel];
        [_collectLabel release];
        
        self.priceLabel = [[UILabel alloc] init];
        self.priceLabel.textColor = [UIColor redColor];
        self.priceLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:self.priceLabel];
        [_priceLabel release];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.leftImage.frame = CGRectMake(0, 0, 150 * WIDTH / 375, HEIGHT);
    self.titleLabel.frame = CGRectMake(165 * WIDTH / 375, 5 * HEIGHT / 100, 200 * WIDTH / 375, 40 * HEIGHT / 100);
    self.collectLabel.frame = CGRectMake(165 * WIDTH / 375, 65 * HEIGHT / 100, 100 * WIDTH / 375, 30  *HEIGHT / 100);
    self.priceLabel.frame = CGRectMake(300 * WIDTH / 375, 65 * HEIGHT / 100, 70 * WIDTH / 375, 30 * HEIGHT / 100);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
